﻿using DAL;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.Report
{
    /// <summary>
    /// 疫情上报
    /// </summary>
    public class ReportOnEpidemicSituationBLL
    {
        /// <summary>
        /// 根据id获取单条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ReportOnEpidemicSituationModel GetSingleDataById(string id)
        {
            return new ReportOnEpidemicSituationDal().GetSingleDataById(id);
        }

        /// <summary>
        /// 疫情上报分页列表
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectName"></param>
        /// <param name="FillInDateStart"></param>
        /// <param name="FillInDateEnd"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public List<ReportOnEpidemicSituationModel> GetDataList(string departId, string userName, string projectName, string FillInDateStart, string FillInDateEnd, int pageSize, int pageIndex, out int total)
        {
            return new ReportOnEpidemicSituationDal().GetDataList(departId,userName, projectName, FillInDateStart, FillInDateEnd, pageSize, pageIndex, out total);
        }

        /// <summary>
        /// 体温上报汇总（正常体温）
        /// </summary>
        /// <param name="thm"></param>
        /// <returns></returns>
        public bool InsertReport(ReportOnEpidemicSituationModel thm)
        {
            //{“Id”:"","userName":"张大炮","userId":"110110","DepartId":"10001000","DepartName":"单位一","FillInDate":"2019-01-01","FillInNum":10,“AddDiagnosisNum”:0,"AddSuspectedNum":2,"AddCureNum":0}
            return new ReportOnEpidemicSituationDal().InsertReport(thm);
        }

        /// <summary>
        /// 计算上报人数
        /// </summary>
        /// <param name="FillInDate"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int GetFillInNum(DateTime FillInDate, TwtzModel entity)
        {
            return new ReportOnEpidemicSituationDal().GetFillInNum(FillInDate, entity);
        }

        /// <summary>
        /// 计算疑似人数
        /// </summary>
        /// <param name="FillInDate"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int GetSuspectedNum(DateTime FillInDate, TwtzModel entity)
        {
            return new ReportOnEpidemicSituationDal().GetSuspectedNum(FillInDate, entity);
        }

        /// <summary>
        /// 修改单条数据
        /// </summary>
        /// <param name="thm"></param>
        /// <returns></returns>
        public bool Update(string id,int AddDiagnosisNum,int AddCureNum)
        {
            return new ReportOnEpidemicSituationDal().Update(id, AddDiagnosisNum, AddCureNum);
        }

        /// <summary>
        /// 累计数据
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public int sum(string type)
        {
            return new ReportOnEpidemicSituationDal().sum(type);
        }
    }
}
